import request from '@/config/axios'

// APP用户 VO
export interface AppUserVO {
  id: number // 主键
  nickName: string // 昵称
  phoneNumber: string // 手机号
  companyId:number,
  curator:number,
  openid:string,
  appId: string
}

// APP用户 API
export const AppUserApi = {
  // 查询APP用户分页
  getAppUserPage: async (params: any) => {
    return await request.get({ url: `/system/app-user/page`, params })
  },

  // 查询APP用户详情
  getAppUser: async (id: number) => {
    return await request.get({ url: `/system/app-user/get?id=` + id })
  },

  // 新增APP用户
  createAppUser: async (data: AppUserVO) => {
    return await request.post({ url: `/system/app-user/create`, data })
  },

  // 修改APP用户
  updateAppUser: async (data: AppUserVO) => {
    return await request.put({ url: `/system/app-user/update`, data })
  },

  // 删除APP用户
  deleteAppUser: async (id: number) => {
    return await request.delete({ url: `/system/app-user/delete?id=` + id })
  },

  // 导出APP用户 Excel
  exportAppUser: async (params) => {
    return await request.download({ url: `/system/app-user/export-excel`, params })
  },

  listCompanyUsers: async (companyId:number) => {
    return await request.get({ url: `/system/app-user/listUsers/${companyId}` })
  }
}